import Vue from "vue";
import VueRouter from "vue-router";
import routes from "./routes";

Vue.use(VueRouter);

const oldPushMethod = VueRouter.prototype.push
VueRouter.prototype.push = function(location,onComplate=()=>{},onAbort=()=>{}){
    return oldPushMethod.call(this,location,onComplate,onAbort)
}

const oldReplaceMethod = VueRouter.prototype.push
VueRouter.prototype.push = function(location,onComplate=()=>{},onAbort=()=>{}){
    return oldReplaceMethod.call(this,location,onComplate,onAbort)
}
const router = new VueRouter({
    mode: "history",
    routes
});

export default router;
